//
//  Swizzling.h
//  SDSY
//
//  Created by 蓝布鲁 on 2017/3/28.
//  Copyright (c) 2017 蓝布鲁. All rights reserved.
//

#ifndef Swizzling_h
#define Swizzling_h

#include <objc/runtime.h>
static inline void swizzling_exchangeMethod(Class clazz, SEL originalSelector, SEL exchangeSelector) {
    // 获取原方法
    Method originalMethod = class_getInstanceMethod(clazz, originalSelector);

    // 获取需要交换的方法
    Method exchangeMethod = class_getInstanceMethod(clazz, exchangeSelector);

    // 交换两个方法
    method_exchangeImplementations(originalMethod, exchangeMethod);

}

#endif /* Swizzling_h */
